<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>群成员列表</title>
    <?php PrintPageHead(); ?>
    <link href="../resource/css/hermes.css" rel="stylesheet">
    <link href="../resource/js/calendar/calendar-blue.css" type="text/css" rel="stylesheet">
    <script src="../resource/js/calendar/calendar.js" type="text/javascript"></script>
    <script src="../resource/js/hermes.js"></script>
    <style type="text/css">
        .divleft{width: 33%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divcenter{width: 33%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2%}

        .divright{ width: 28%; float: left; text-align:left;  margin-right: 2%}
        .position {
            position: absolute;
            display: none;
            z-index: 15;
            width: 400px;
            height: 40px;
            margin: -20px 0 0 -75px;
            padding: 0 10px;
            background: #eee;
            line-height: 2.4;
            cursor:pointer;
        }
    </style>
    <?php
    if (!array_key_exists("公众号ID",$_SESSION)) {
        header("Location:back.php");
    }
    pdo()->beginTransaction();
    $bm=new C后台管理员();
    $act = $_GET['act']==''?1:$_GET['act'];
    $本页面 = 'back.php?state=back10QunCY_List';
    $Get群成员列表=$bm->Get群成员列表($_GET['page'],$_GET,$_POST['keywords'],$_GET['id']);
//var_dump($Get群成员列表);
    ?>
</head>
<body>


<div class="container-fluid">
    <?php include_once 'back_header.php'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">群成员列表</h3></div>
        <div class="panel-body" style="text-align:center">
            <div style="margin: 0 0 10px 0;text-align:left"><b style="color:#3c763d;font-size: 16px;">群成员查询</b><br/>
                <form action="" method="post">
                    <input type="text" name="keywords" value="<?=$_POST['keywords']?>">&nbsp;&nbsp;
                    <button type="submit"  class="btn btn-default btn-success ">&nbsp;查 询&nbsp;</button></form></div>
            <div class="panel-group"  id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row" >
                          <div class="divleft">
                               成员名称
                            </div>
                            <div class="divcenter">
                                角色
                            </div>

                            <div class="divright" style="text-align:center">
                                操作
                            </div>
                        </div>
                    </div>
                </div>
                <?php foreach($Get群成员列表['result'] as $v){?>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="row" >
                                <div class="divleft">
                                    <?=$v['name']?>
                                </div>
                                <div class="divcenter">
                                    <?=$v['角色']?>
                                </div>
                                <div class="divright" style="text-align:center">
                                    <?php if($v['角色']!=='群主'){?>
                                    <a href="#" onclick="fun('<?=$v['用户id']?>','<?=$v['群id']?>')">删除</a><input type="hidden" value="<?=$本页面?>&id=<?=$v['群id']?>" id="链接"/>
                                    <?php }?>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php }
                if(!$Get群成员列表['result']){
                ?>
                <div class="panel-heading text-center"><h3 class="panel-title">没有数据 !!!</h3></div>
                <?php }?>
            </div>
            <?=$Get群成员列表['show']?>
        </div>

    </div>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="../resource/js/jquery-1.11.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../resource/js/bootstrap.min.js"></script>
<script language="JavaScript">
    $(function(){
        $(".fun").click(function(){
            $(this).next("div").show();
        })
        $(".fun1").click(function(){
            $(this).parent("div").hide();
        })
    })
function fun(用户id,群id){
    var 链接 = $("#链接").val();
    if(window.confirm('您确定要删除该成员及聊天记录吗?')){
        $.ajax({
            type:'post',
            url:'BackSellerAjax.php?businessFlag=删除群成员',
            data:{用户id:用户id,群id:群id},
            success:function(msg){
                if(msg){
                    alert('删除成功!');
                    window.location.href=链接;
                }else{
                    alert('删除失败!');
                }
            }
        })
    }
}
</script>
</body>
</html>